#include "OutputListBox.h"
#include "LengthDisplayFormat.h"

void OutputListBox::display(ostream& os)
{
	personList_m = new PersonList(displayFormat_m);
	if (displayFormat_m)
		os_m << (*personList_m);
}
	
void OutputListBox::update() 
{
        /*//get status from RadioButton
        StatusHandler statusHandler->getDisplayFormat();*/
        
        radioButton_onSelected();
	display(os_m);
}
	
void OutputListBox::radioButton_onSelected()
{
	if (radioButtonCasc_m->checked_m)  
		displayFormat_m = new FeetInchUnitDisplay();
	else if(radioButtonInch_m->checked_m)
		displayFormat_m = new InchUnitDisplay();
	else
		displayFormat_m = new CascadeUnitDisplay();
}
	
